import Vue from 'vue'
import Router from 'vue-router'

import Login from "../views/home/login";
import fandpassword from "../views/home/fandpassword";
import Layout from "../components/layouts/Layout";
import TenantUsermanage from "../views/tenant/TenantUsermanage";
import UserHome from "../views/user/userHome";
import UserGroup from "../views/user/userGroup";
import UserSurvey from "../views/user/userSurvey";
import authorityManagement from "../views/admin/authorityManagement";
import adminHome from "../views/admin/adminHome";
import chargeManagement from "../views/admin/chargeManagement";
import AdminLayout from "../components/layouts/AdminLayout";
import TentantLayout from "../components/layouts/TentantLayout";
import Selfaccount from "../views/user/Selfaccount";
import SelfPwd from "../views/user/SelfPwd";
import selfSecurity from "../views/user/SelfSecurity";
import TenantSelfaccount from "../views/tenant/TenantSelfaccount";
import TenantSelfPwd from "../views/tenant/TenantSelfPwd";
import TenantSelfSecurity from "../views/tenant/TenantSelfSecurity";
import adminSelfaccount from "../views/admin/adminSelfaccount";
import adminSelfPwd from "../views/admin/adminSelfPwd";
import Edit from '../views/user/questionnairePage/Edit'
import Fill from '../views/user/questionnairePage/Fill'
import QuestionList from "../views/user/questionList";
import feedbackPage from "../views/common/feedback";
import suggestionBox from '../views/common/suggestionBox';
import answererFinishQuestionnaire from "../views/answerer/answererFinishQuestionnaire";
import answererSelfaccount from "../views/answerer/answererSelfaccount";
import answererSelfPwd from "../views/answerer/answererSelfPwd";
import AnswerLayout from "../components/layouts/AnswerLayout";
import answererView from "../views/answerer/answererView";
import Preview from "../views/user/questionnairePage/Preview";

import successdemo from "../views/home/successdemo";
import answererCheckanswer from "../views/answerer/answererCheckanswer";
import answerLogin from "../views/home/answerLogin";
import chargeDataAnalysis from "../views/admin/chargeDataAnalysis";
import touristFinishSurvey from "../views/answerer/touristFinishSurvey";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/', redirect: 'login'
    },
    {
      path: '/login',
      component: Login
    },
    {
      path:'/answerlogin',
      component:answerLogin
    },
    {path: '/touristFinishSurvey',name:'touristFinishSurvey',component: touristFinishSurvey},
    {
      path: '/demo',
      component: successdemo
    },
    {
      path: '/fandpassword',
      component: fandpassword
    },
    {
      path: '/user', meta: '首页', component: Layout,
      children: [
        {path: '', redirect: 'answerer'},
        {path: 'answerer', groupName: 'UserHome', component: UserHome},
        {path: 'account', component: Selfaccount},
        {path: 'pwd', component: SelfPwd},
        {path: 'security', component: selfSecurity},
        {path: 'group', component: UserGroup},
        {path: 'questionList',component: QuestionList},
        {path: 'feedback',component: feedbackPage},
        {path: 'survey', component: UserSurvey},


        // {path: 'surveyList', component: List},
        // {path: 'fill/:id', name: 'Fill', component: Fill},
        // {path: 'data/:id', name: 'Data', component: Data},
        // {path: 'edit/:id', name: 'Edit', component: Edit},
        // {path: 'datepicker', name: 'Datepicker', component: Datepicker}
      ]
    },
    {path: '/fill/:id', name: 'Fill', component: Fill},

    {path: '/editSurvey', name: 'Edit', component: Edit},

    {path: '/previewSurvey', name: 'Preview', component: Preview},
    {
      path: '/admin', meta: '管理员主页', component: AdminLayout,
      children: [
        {path: '', redirect: 'tenantManagement'},
        {path: 'tenantManagement', name: 'adminHome', component: adminHome},
        {path: 'authorityManagement', name: 'authorityManagement', component: authorityManagement},
        {path: 'chargeManagement', name: 'chargeManagement', component: chargeManagement},
        {path: 'account',name: 'adminSelfaccount',component: adminSelfaccount},
        {path: 'pwd',name: 'adminSelfPwd',component: adminSelfPwd},
        {path: 'suggestionBox',name: 'suggestionBox',component: suggestionBox},
        {path: 'chargeDataAnalysis', name: 'chargeDataAnalysis', component: chargeDataAnalysis}
      ]
    },
    {
      path:'/answerer',meta:'答者主页',component:AnswerLayout,
      children:[
        {path: '',redirect: 'View'},
        {path: 'View',name:'View',component: answererView},

        {path: 'account',name:'answereraccount',component: answererSelfaccount},
        {path: 'pwd',name:'answererPwd',component: answererSelfPwd},
      ]
    },
    {path: '/answerer/FinishQuestionnaire',name:'FinishQuestionnaire',component: answererFinishQuestionnaire},
    {path: '/answerer/Checkanswer',name:'Checkanswer',component: answererCheckanswer},

    {
      path: '/tenant', meta: '租户主页', component: TentantLayout,
      children: [
        {path: '', redirect: 'tenantUsermanage'},
        {path: 'tenantUsermanage', name: 'tenantUsermanage', component: TenantUsermanage},
        {path: 'account', name: 'tenantSelfacount', component: TenantSelfaccount},
        {path: 'pwd', name: 'tenantSelfPwd', component: TenantSelfPwd},
        {path: 'security', name: 'tenantSelfSecurity', component: TenantSelfSecurity},
        {path: 'feedback',component: feedbackPage},

      ]
    }
  ]
})
